<template>
    <div class="container">

        <div class="main">
            <div class="title">证券开户</div>

            <div class="box" v-for="(item,index) in tableData" :key="item.id" @mouseover="mouseOver(index)" @mouseleave="mouseLeave(index)">
                <el-image style="width: 100%; height: 100%;border-radius: 8px" :src="imgUrl + item.pcImage" fit="cover"></el-image>

                <div class="dialog-content arrow-box" v-show="index === active">
                    <div class="dialog">
                        <div class="dialog-left">
                            <el-image slot="reference" style="width: 225px; height: 225px" :src="imgUrl + item.qrcode" fit="cover"></el-image>
                        </div>
                        <div class="dialog-right">
                            <p>请使用</p>
                            <p>微信扫一扫</p>
                            <p>进入开户页面</p>
                        </div>
                    </div>
                </div>

            </div>

        </div>


    </div>
</template>

<script>

import {list} from "../api/index";
import {PRODUCT_URL} from "@/common/const";

export default {
    name: "Home",
    data() {
        return {
            imgUrl: PRODUCT_URL + '/yngpProduct',
            tableData: [],
            active: ''
        }
    },
    mounted() {
        this.init();
    },
    methods: {
        async init() {
            await list().then(res => {
                console.log(res)
                this.tableData = res.data;
            }).catch(err => {

            })
        },
        //鼠标移入事件
        mouseOver(index) {
            this.active = index;
            console.log("aaaa")
        },
        //鼠标移除事件
        mouseLeave() {
            this.active = '';
        }
    }
}
</script>

<style lang="scss" scoped>


.container {
    width: 100%;
    min-height: 100%;
    padding-bottom: 300px;
    background-color: #FFFFFF;
}

.main {
    width: 670px;
    height: auto;
    margin: 0 auto;

    .title {
        padding-top: 29px;
        padding-bottom: 22px;
        font-size: 28px;
        color: #333333;
        font-weight: bold;
    }

    .box {
        width: 670px;
        height: 165px;
        background: #E0E0E0;
        border: 1px solid #F0F0F0;
        border-radius: 2px;
        margin-bottom: 10px;
        position: relative;
        border-radius: 8px
    }
}

.dialog-content {
    position: absolute;
    right: 27px;
    top: 155px;
    z-index: 10;
    width: 426px;
    height: 280px;
    background: #E6E6E6;
    border: 1px solid #CCCCCC;
    box-shadow: 0px 0px 18px 0px rgba(0, 0, 0, 0.1400);
    border-radius: 8px;
    padding: 8px 8px 0 8px;
}

.dialog {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background-color: #FFFFFF;

    .dialog-left {
        width: 226px;
        height: 225px;
        border: 6px solid #FF9540;
        border-radius: 10px;
    }

    .dialog-right {
        padding-left: 15px;
        font-size: 22px;
        color: #333333;
        line-height: 40px;
    }
}


.arrow-box::after, .arrow-box::before {
    position: absolute;
    bottom: 100%;
    left: calc(94% - 18px);
    border: solid transparent;
    content: "";
    height: 0;
    width: 0;
    pointer-events: none;
}

.arrow-box::after {
    border-color: transparent;
    border-bottom-color: #E0E0E0;
    border-width: 16px;
    margin-left: -16px;
}

.arrow-box::before {
    border-color: transparent;
    border-bottom-color: #cccccc;
    border-width: 19px;
    margin-left: -19px;
}



</style>

